﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TMI85303.Utils
{
    public static class FileHelper
    {
        public static bool IsExistDirectory(string path, bool createNewDirectory=true)
        {

            if (Directory.Exists(path))
            {
                return true;
            }
            else if (createNewDirectory)
            {
                try
                {
                    new DirectoryInfo(path).Create();
                    return true;
                }catch (Exception)
                {
                    return false;
                }
            }
            return false;
        }
    }
}
